package com.xdkj.web.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * ClassName GlobalListener
 * Description:
 *
 * @Author:一尘
 * @Version:1.0
 * @Date:2021-11-02-9:58
 */
@WebListener
public class GlobalListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        ServletContext servletContext = sce.getServletContext();
        servletContext.setAttribute("ctx", servletContext.getContextPath());
    }
}
